home *** CD-ROM | disk | FTP | other *** search
/ PCGUIA 127 / PC Guia 127.iso / Software / Produtividade / OpenOffice.org 2.0.1 / openofficeorg1.cab / RoadMap.xba < prev    next >
Extensible Markup Language  |  2004-05-19  |  3KB  |  117 lines

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
  3. <script:module xmlns:script="http://openoffice.org/2000/script" script:name="RoadMap" script:language="StarBasic">REM  *****  BASIC  *****
  4. Dim oControlModel
  5. Dim oDialogModel
  6. Dim CurrentItem
  7. Dim bLongString
  8. Dim oControl
  9. Dim oEvent
  10. Dim oUseDialog As Object 
  11. Dim oModulName As Object 
  12.  
  13. Sub RoadMapMain(ModulNameforItemChange, dialogtoUse)
  14.     GlobalScope.BasicLibraries.LoadLibrary("Tools")    
  15.     oUseDialog = dialogtoUse
  16.     oModulName = ModulNameforItemChange
  17.     oDialogModel = oUseDialog.Model
  18.     oControlModel = oUseDialog.Model.CreateInstance("com.sun.star.awt.UnoControlRoadmapModel")    
  19.     
  20.     oDialogModel.insertByName("RoadMap", oControlModel)
  21.     oControl = oUseDialog.getControl("RoadMap")    
  22.     oEvent = createUnoListener( "CallBack_", "com.sun.star.awt.XItemListener" )
  23.     oControl.addItemListener(oEvent)    
  24.     oControlModel.CurrentItemID = 0
  25.     oControlModel.Complete = True
  26.     oControlModel.Activated = True    
  27. End Sub
  28.  
  29. Sub SetVisibleRoadMap(param)
  30.     oControl.SetVisible(param)    
  31. End Sub
  32.  
  33. Sub SetDialogModelSize(Width, Height)
  34.     oDialogModel.Width = Width
  35.     oDialogModel.Height = Height    
  36. End Sub
  37.  
  38. Sub SetControlModelPosSize(X, Y, Width, Height)
  39.     oControlModel.PositionX = X
  40.     oControlModel.PositionY = Y
  41.     oControlModel.Width = Width
  42.     oControlModel.Height = Height    
  43. End Sub
  44.  
  45. Sub SetControlModelText( ModelText As String)
  46.     oControlModel.Text = ModelText    
  47. End Sub
  48.  
  49. Sub InsertItemsLabels( ItemLabelsArray() As String)
  50.     For i = 0 To Ubound(ItemLabelsArray())        
  51.         oRoadmapItem = oControlModel.createInstance()        
  52.         oRoadmapItem.Label = ItemLabelsArray(i)
  53.         oRoadmapItem.ID = i
  54.         oControlModel.insertbyIndex(i, oRoadmapItem)
  55.     Next i
  56. End Sub
  57.  
  58. Sub SetItemEnabled( ItemIndex, param)
  59.     oControlModel.getByIndex(ItemIndex).Enabled = param
  60.     oControlModel.CurrentItemID = ItemIndex
  61. End Sub
  62.  
  63. Sub AddImagetoControlModel( Url As String)
  64.     oControlModel.ImageUrl = ConvertToUrl(Url)    
  65. End Sub
  66.  
  67. Function GetSelectedIndex()
  68.     GetSelectedIndex() = oControlModel.CurrentItemID    
  69. End Function
  70.  
  71. Function GetControlModel()
  72.     GetControlModel = oControlModel    
  73. End Function
  74.  
  75. Function GetDialogModel()
  76.     GetDialogModel = oDialogModel    
  77. End Function
  78.  
  79. Sub Callback_itemStateChanged(aEvent)
  80.     oModulName.ItemChange(oControlModel.CurrentItemID, aEvent.itemID)
  81. End Sub
  82.  
  83. Sub SetComplete(param)
  84.     oControlModel.Complete = param
  85. End Sub
  86.  
  87. Sub SetActivated(param)
  88.     oControlModel.Activated = param
  89. End Sub
  90.  
  91. Sub RemoveItem(ItemIndex)
  92.     If ItemIndex > -1 Then
  93.         oControlModel.removeByIndex(ItemIndex)
  94.     End If
  95. End Sub
  96.  
  97. Sub InsertItem(ItemLabel As String)
  98.     oRoadmapItem = oControlModel.createInstance()
  99.     oRoadmapItem.Label = ItemLabel
  100.     oControlModel.insertbyIndex(oControlModel.CurrentItemID, oRoadmapItem)    
  101. End Sub
  102.  
  103. Sub ReplaceItem(ItemLabel As String)
  104.     oRoadmapItem = oControlModel.createInstance()
  105.     oRoadmapItem.Label = ItemLabel
  106.     oControlModel.replacebyIndex(oControlModel.CurrentItemID, oRoadmapItem)
  107. End Sub
  108.  
  109. Sub Callback_disposing(aEvent)
  110. End Sub
  111.  
  112. Sub Property_propertyChange(aEvent)
  113. End Sub
  114.  
  115. Sub Property_disposing(aEvent)
  116. End Sub
  117. </script:module>